#! /bin/bash

sudo kill  -9 $(pgrep python)

cd lib
python go-pylons.py pylons

cd ..

source lib/pylons/bin/activate

paster serve --reload test.ini --stop-daemon
paster serve --reload test.ini --daemon

cd solr

if ps uax | grep -i "java -jar start.jar" > /dev/null
then
    kill `ps uax | grep -i "java -jar start.jar" | awk '{print $2}'`
fi

java -jar start.jar &
cd ..
cd ..